package pl.streamsoft.currencyApp.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Embeddable
public class CurrencyValue implements Serializable {

	@Column(name = "VALUE", nullable=false)
	private BigDecimal averageRate;

	@Column(name = "DATE_OF_PUBLICATION", nullable=false)
	@Temporal(TemporalType.DATE)
	private Date dateOfPublication;

	public CurrencyValue(){}
	
	public CurrencyValue(BigDecimal averegateRate, Date dateOfPublication){
		this.averageRate = averegateRate;
		this.dateOfPublication = dateOfPublication;
	}
	
	public BigDecimal getAverageRate() {
		return averageRate;
	}

	public void setAverageRate(BigDecimal averageRate) {
		this.averageRate = averageRate;
	}

	public Date getDateOfPublication() {
		return dateOfPublication;
	}

	public void setDateOfPublication(Date dateOfPublication) {
		this.dateOfPublication = dateOfPublication;
	}
}
